from typing import Optional, Dict, Any, List
from datetime import datetime

class BusinessParametersGoods:
    def __init__(self, goods_id: str = None, goods_name: str = None, 
                 goods_code: str = None, category_id: str = None,
                 price: float = None, stock: int = None, **kwargs):
        self.goods_id = goods_id
        self.goods_name = goods_name
        self.goods_code = goods_code
        self.category_id = category_id
        self.price = price
        self.stock = stock
        self.extra_params = kwargs
        self.created_at = datetime.now()
    
    def to_dict(self) -> Dict[str, Any]:
        return {
            "goods_id": self.goods_id,
            "goods_name": self.goods_name,
            "goods_code": self.goods_code,
            "category_id": self.category_id,
            "price": self.price,
            "stock": self.stock,
            "created_at": self.created_at.isoformat(),
            **self.extra_params
        }
